#!/usr/bin/python3
import sys

try:
    def abd(x, y, z):
        x_i = y.index(x)
        x_x = x_i // int(z[1])
        x_y = x_i % int(z[1])
        x1 = chr(ord(x) + 32)
        x1_i = y.index(x1)
        x1_x = x1_i // int(z[1])
        x1_y = x1_i % int(z[1])
        anser = abs(x1_x - x_x) + abs(x1_y - x_y)
        return anser


    t = int(input())
    if t < 1 or t > 100:
        sys.exit(0)
    ret = ''
    for x in range(t):
        a_str = [int(item) for item in input().split()]
        n = a_str[0]
        m = a_str[1]
        k = a_str[2]
        d = []
        for i in range(n):
            d += list(input())
        e = []
        for ii in range(65, 97):
            if chr(ii) in d:
                xx = abd(chr(ii), d, a_str)
                e.append(xx)
        an = e.index(min(e))
        bn = list(range(97, 123))
        bn1 = chr(bn[an])
        print(bn1)

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
